gl: Fix the required version setter
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 10 Feb 2015 10:16:53 +0000 (10:16 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 10 Feb 2015 10:16:53 +0000 (10:16 +0000)
We don't allow a version tuple to be lower than (3, 2), but we should
allow versions above that.

https://bugzilla.gnome.org/show_bug.cgi?id=744212

gdk/gdkglcontext.c

index dda1b61cd15044bfc24b353fb02e4a935a1d075e..5001c71b1e516081c73a3d071547f364181b270d 100644 (file)
@@ -523,8 +523,21 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
   g_return_if_fail (GDK_IS_GL_CONTEXT (context));
   g_return_if_fail (!priv->realized);
 
+  /* this will take care of the default */
+  if (major == 0 && minor == 0)
+    {
+      priv->major = 0;
+      priv->minor = 0;
+      return;
+    }
+
   priv->major = MAX (major, 3);
-  priv->minor = MAX (minor, 2);
+
+  /* we only support versions ≥ 3.2 */
+  if (priv->major == 3)
+    priv->minor = MAX (minor, 2);
+  else
+    priv->minor = minor;
 }
 
 /**